import { PORT3 } from "@/api/config/servicePort";
import http from "@/api";
import { Package, TagPackage } from "../interface/tagPackage";
import { defaultParams } from "@/interface/public";

// 保存标重容器
export const tagPackageSave = (params: TagPackage.Save) => http.post(PORT3 + `/tagPackage/save`, params);

// 标识为已使用状态
export const tagPackageDisable = (params: defaultParams) => http.post(PORT3 + `/tagPackage/disable/${params.id}`);

// 分页查询
export const tagPackagePage = (params: TagPackage.SearchParams) =>
  http.post<TagPackage.Search>(PORT3 + `/tagPackage/page`, params);

// 根据编号查询对象
export const tagPackageByCode = (params: { code: string }) =>
  http.get<TagPackage.SearchProps>(PORT3 + `/tagPackage/byCode/${params.code}`);

//--------固定容器----------

// 保存标重容器
export const packageSave = (params: Package.Save) => http.post(PORT3 + `/package/save`, params);

// 删除容器
export const packageRemove = (params: defaultParams) => http.post(PORT3 + `/package/remove/${params.id}`);

// 启用容器
export const packageEnable = (params: defaultParams) => http.post(PORT3 + `/package/enable/${params.id}`);

// 保存标重容器
export const packageDisable = (params: defaultParams) => http.post(PORT3 + `/package/disable/${params.id}`);

// 查询编号下的容器
export const packageByCode = (params: defaultParams) => http.get<Package.Search>(PORT3 + `/package/byCode/${params.id}`);

// 分页查询容器
export const packagePage = (params: Package.SearchParams) => http.post<Package.Search[]>(PORT3 + `/package/page`, params);
